import { GModuleEvent } from "../../../mvc/GModuleEvent";
import { Cache } from "../../../cache/Cache";
import { RoleEquipInfoPanel } from "./RoleEquipInfoPanel";
import { RoleInfoPanel } from "./RoleInfoPanel";
import { AttributeInfoPanel } from "./AttributeInfoPanel";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GComboBox } from "../../../../../com/mui/controls/GComboBox";
import { MailFriendItemCellRender } from "../../mail/MailFriendItemCellRender";
import { ResouceConst } from "../../../../component/gconst/ResouceConst";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFormat } from "../../../../common/GTextFormat";
import { SFightAttribute } from "../../../../../Message/Public/SFightAttribute";
import { SPlayerMarry } from "../../../../../Message/Public/SPlayerMarry";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { SPlayerGuildInfo } from "../../../../../Message/Game/SPlayerGuildInfo";
type int = number;
//class PlayerEquipInfoPanel
    
    export  class PlayerEquipInfoPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        public showFightSpirit(arg1: int): void
        {
            this._roleEquipInfoPanel.showFightSpirit(arg1);
            return;
        }

        public guideFightSpirit(): void
        {
            this._roleEquipInfoPanel.guideFightSpirit();
            return;
        }

        public roleLevelUpdate(): void
        {
            if (this._mode == GModuleEvent.Mode_Self) 
            {
                this._roleEquipInfoPanel.updateMedelShow(Cache.instance.role.entityInfo.level);
            }
            return;
        }

        public updateFashionJewelInfo(arg1: Array<any>, arg2: int): void
        {
            if (this._roleEquipInfoPanel) 
            {
                this._roleEquipInfoPanel.updateFashionJewelInfo(arg1, arg2);
            }
            return;
        }

        public updateFashionFlyLv(arg1: int, arg2: int): void
        {
            if (this._roleEquipInfoPanel) 
            {
                this._roleEquipInfoPanel.updateFashionFlyLv(arg1, arg2);
            }
            return;
        }

        public get mode(): string
        {
            return this._mode;
        }

        public set mode(arg1: string)
        {
            this._mode = arg1;
            this._roleEquipInfoPanel.mode = arg1;
            this._roleInfoPanel.mode = arg1;
            this._attributeInfoPanel.mode = arg1;
            return;
        }

        /* internal  */init(): void
        {
            this._roleEquipInfoPanel = new RoleEquipInfoPanel();
            this._roleEquipInfoPanel.x = 7;
            this._roleEquipInfoPanel.y = 67;
            this.addChild(this._roleEquipInfoPanel);
            this._roleInfoPanel = new RoleInfoPanel();
            this._roleInfoPanel.x = 7;
            this._roleInfoPanel.y = 2;
            addChild(this._roleInfoPanel);
            if (this._mode == GModuleEvent.Mode_Self) 
            {
                this.updateTitle();
            }
            this._attributeInfoPanel = new AttributeInfoPanel();
            this._attributeInfoPanel.x = 263;
            this._attributeInfoPanel.y = 67;
            this.addChildAt(this._attributeInfoPanel, 0);
            return;
        }

        public showVipImg(arg1: int=-1): void
        {
            this._roleEquipInfoPanel.showVipImg(arg1);
            return;
        }

        public updateCareerUI(): void
        {
            this._roleEquipInfoPanel.updateCareerUI();
            return;
        }

        public updateEnableCareer(): void
        {
            this._roleEquipInfoPanel.updateCareerUI();
            return;
        }

        /* internal  */createComboBox(arg1: int, arg2: int, arg3: int, arg4: int, arg5: DataProvider): GComboBox
        {
            var loc1;
            (loc1 = new GComboBox()).selectedIndex = 0;
            loc1.width = arg3;
            loc1.height = arg4;
            loc1.move(arg1, arg2);
            loc1.styleName = "GComboboxStyle";
            loc1.drawNow();
            loc1.dropdown.setStyle("cellRenderer", MailFriendItemCellRender);
            loc1.dropdown.setStyle("skin", ResouceConst.getScaleBitmap(ImagesConst.WindowCenterB));
            loc1.textField.setStyle("textFormat", new GTextFormat("", 12, 11661308, false, false, false, "", "", flash.text.TextFormatAlign.CENTER));
            loc1.dataProvider = arg5;
            return loc1;
        }

        public setLifeValue(arg1: number, arg2: number): void
        {
            if (arg2 > arg1) 
            {
                arg2 = arg1;
            }
            this._attributeInfoPanel._shengmingBar.setValue(arg2, arg1);
            return;
        }

        public setMagicValue(arg1: number, arg2: number): void
        {
            if (arg2 > arg1) 
            {
                arg2 = arg1;
            }
            this._attributeInfoPanel._mofaBar.setValue(arg2, arg1);
            return;
        }

        public setExperienceValue(arg1: number, arg2: number): void
        {
            this._roleEquipInfoPanel.updateExp(arg1, arg2);
            return;
        }

        public setFighting(arg1: string): void
        {
            this._attributeInfoPanel.updateFightStrength(arg1);
            return;
        }

        public updateAttr(arg1: SFightAttribute, arg2: SFightAttribute, arg3: int): void
        {
            this._fightData = arg1;
            this._attributeInfoPanel.updateAttrText(this._fightData, arg3);
            return;
        }

        public updateHeadInfo(arg1: string, arg2: int, arg3: int, arg4: int, arg5: int, arg6: string, arg7: int, arg8: SPlayerMarry): void
        {
            this._roleInfoPanel.setInfoText(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
            if (arg8 != null) 
            {
                this.updateMarryInfo();
            }
            this._roleEquipInfoPanel.updateInfos(arg1, arg2, arg3);
            return;
        }

        public setEquipments(arg1: Array<any>, arg2: int, arg3: Array<any>, arg4: int, arg5: int=-1, arg6: int=-1, arg7: int=0, arg8: Boolean=false, arg9: Boolean=false, arg10: Boolean=false, arg11: Boolean=false, arg12: Boolean=false, arg13: Boolean=false): void
        {
            this._roleEquipInfoPanel.setEquipments(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
            return;
        }

        public updateOtherEquipments(): void
        {
            this._roleEquipInfoPanel.updateOtherEquipments();
            return;
        }

        public updateAddInfos(): void
        {
            this._roleEquipInfoPanel.updateAddInfos();
            return;
        }

        /* internal  */onGloryBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.TitleWindowShowOrHide));
            return;
        }

        public updateTitle(): void
        {
            this._roleInfoPanel.updateTitle();
            return;
        }

        public setTitleName(arg1: string): void
        {
            this._roleInfoPanel.setTitleName(arg1);
            return;
        }

        public updataIsShowFashion(): void
        {
            this._roleEquipInfoPanel.updataIsShowFashion();
            return;
        }

        public updateIsShowWing(): void
        {
            this._roleEquipInfoPanel.updateIsShowWing();
            return;
        }

        public updateIsShowFashionWeapon(): void
        {
            this._roleEquipInfoPanel.updateIsShowFashionWeapon();
            return;
        }

        public updateIsShowFootPrint(): void
        {
            this._roleEquipInfoPanel.updateIsShowFootPrint();
            return;
        }

        public updateIsShowBubble(): void
        {
            this._roleEquipInfoPanel.updateIsShowBubble();
            return;
        }

        public updateIsShowSurround(): void
        {
            this._roleEquipInfoPanel.updateIsShowSurround();
            return;
        }

        public updateIsShowWaistBelt(): void
        {
            this._roleEquipInfoPanel.updateIsShowWaistBelt();
            return;
        }

        public updateIsShowElf(): void
        {
            this._roleEquipInfoPanel.updateIsShowElf();
            return;
        }

        public updateEquip(): void
        {
            this._roleEquipInfoPanel.updateEquip();
            return;
        }

        public updateSelfGuild(arg1: SPlayerGuildInfo=null): void
        {
            this._roleInfoPanel.updateSelfGuild(arg1);
            return;
        }

        public updateSuitPanel(): void
        {
            this._roleEquipInfoPanel.updateSuitPanel();
            return;
        }

        public updateSuitSkillRate(): void
        {
            this._roleEquipInfoPanel.updateSuitSkillRate();
            return;
        }

        public updateMarryInfo(): void
        {
            if (this._mode == GModuleEvent.Mode_Self) 
            {
                this._roleInfoPanel.updateMarryInfo();
            }
            return;
        }

        public updateSexChange(): void
        {
            this._roleInfoPanel.updateSex();
            this._roleEquipInfoPanel.updateSexChange();
            return;
        }

        public updateCampChange(): void
        {
            this._roleInfoPanel.updateCamp();
            return;
        }

        public updateMedal(): void
        {
            this._roleEquipInfoPanel.updateMedal();
            return;
        }

        public updateWuXingFightInfo(): void
        {
            this._attributeInfoPanel.updateWuXingFightInfo();
            return;
        }

        public guideMedal(): void
        {
            this._roleEquipInfoPanel.guideMedal();
            return;
        }

        public updateUploadAvatar(arg1: int): void
        {
            this._roleInfoPanel.updateUploadAvatar(arg1);
            return;
        }

        public updateRuneFight(arg1: string): void
        {
            this._roleInfoPanel.updateRuneFight(arg1);
            return;
        }

        public updateFightSpirit(arg1: Array<any>, arg2: int, arg3: int): void
        {
            this._roleEquipInfoPanel.updateFightSpirit(arg1, arg2, arg3);
            return;
        }

        /* internal */ /* var */_mode: string="自己";

        /* internal */ /* var */_roleInfoPanel: RoleInfoPanel;

        /* internal */ /* var */_roleEquipInfoPanel: RoleEquipInfoPanel;

        /* internal */ /* var */_attributeInfoPanel: AttributeInfoPanel;

        /* internal */ /* var */_fightData: SFightAttribute;
    }
